import request from '@/utils/request'

/**
 * 获取所有权限点
*/
export function getPermissionList() {
  return request({
    url: '/sys/permission'
  })
}

/**
 * 根据ID获取权限点详情
*/
export function getPermDetailById(id) {
  return request({
    url: `/sys/permission/${id}`
  })
}

/**
 * 根据ID更新权限
*/
export function updatePermisssion(data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'PUT',
    data
  })
}

/**
 * 根据ID删除权限点
*/
export function delPermission(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'DELETE'
  })
}

/**
 * 添加权限点
*/
export function addPermission(data) {
  return request({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}
